/**
 * CoursesEvent.java 21 juil. 07
 *
 * Copyright (c) 2007 windu.2b <jcaddie@windu2b.org>. All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package org.windu2b.jcaddie.model;

import java.util.*;

/**
 * @author windu.2b
 * 
 */
public class CoursesEvent extends EventObject
{
	/**
	 * 
	 */
	private static final long	serialVersionUID	= 4346466699430211393L;



	public enum Type
	{
		ADD,

		UPDATE,

		INCREMENT,

		DECREMENT,

		DELETE;
	}



	private PieceOfProduct	piece;


	private int	           index;


	private Type	       type;




	public CoursesEvent( Object source, PieceOfProduct piece, int index,
	        Type type )
	{
		super( source );
		this.piece = piece;
		this.index = index;
		this.type = type;
	}




	/**
	 * @return the piece
	 */
	public PieceOfProduct getPieceOfProduct()
	{
		return piece;
	}




	/**
	 * @return the index
	 */
	public int getIndex()
	{
		return index;
	}




	/**
	 * @return the piece
	 */
	public PieceOfProduct getPiece()
	{
		return piece;
	}




	/**
	 * @return the type
	 */
	public Type getType()
	{
		return type;
	}
}